import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/components/layout/Layout.vue'
// import Home from '@/views/Home.vue'
import Register from '@/views/Register.vue'
import Login from '@/views/Login.vue'
import Release from '@/views/Release.vue'
import HomePage from '@/views/HomePage.vue'
import SearchPage from '@/views/SearchPage.vue'
import Mine from '@/views/Mine.vue'
import Collection from '@/views/Collection.vue'
import Admin from '@/views/Admin.vue'
import SearchBlock from '@/components/search/SearchBlock.vue'

import Admin_all from '@/components/admin_good/Admin_all.vue'
import Admin_learn from '@/components/admin_good/Admin_learn.vue'
import Admin_zhoubian from '@/components/admin_good/Admin_zhoubian.vue'
import Admin_shenqi from '@/components/admin_good/Admin_shenqi.vue'
import Admin_shuma from '@/components/admin_good/Admin_shuma.vue'
import Admin_fushi from '@/components/admin_good/Admin_fushi.vue'
import Admin_qita from '@/components/admin_good/Admin_qita.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: 'home',
        component: HomePage
      },
      {
        path: 'release',
        component: Release
      },
      {
        path: 'collect',
        component: Collection
      },
      {
        path: 'mine',
        component: Mine
      },
      {
        path: 'search',
        component: SearchPage
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/searchblock',
    component: SearchBlock
  },
  {
    path: '/admin',
    component: Admin,
    children:[
      {
        path: 'all',
        component: Admin_all,
      },
      {
        path: 'learn',
        component: Admin_learn,
      },
      {
        path: 'zhoubian',
        component: Admin_zhoubian,
      },
      {
        path: 'shenqi',
        component: Admin_shenqi,
      },
      {
        path: 'shuma',
        component: Admin_shuma,
      },
      {
        path: 'fushi',
        component: Admin_fushi,
      },
      {
        path: 'qita',
        component: Admin_qita,
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
